package com.coment.po;

import com.fasterxml.jackson.annotation.JsonIgnore;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
import org.springframework.data.annotation.Id;

import java.util.Objects;

/// 用户任务信息
@Getter
@Setter
@NoArgsConstructor
public class UserTaskInfo {
    @JsonIgnore
    @Id
    private int id;

    private Integer userInfoId;

    @Getter
    /// 任务id
    private Integer taskId;

    /// 完成数量
    public int completionCount;

    /// 已领取数量
    public int quantityClaimed;

    /// 创建方法
    public UserTaskInfo(Integer userInfoId, Integer taskId) {
        this.userInfoId = userInfoId;
        this.taskId = taskId;
        this.completionCount = 0;
        this.quantityClaimed = 0;
        this.id = Objects.hash(userInfoId, taskId);
    }
}
